<template>
  <div class="right-container">
    <h3>Right 组件</h3>
    <!-- <h4>状态:{{ $store.getters.allDone }}</h4> -->
    <h4>状态:{{ allDone }}</h4>
    <hr />
    <p>count 值：{{ count }}</p>
    <button class="btn btn-warning" @click="fn">-1</button>
  </div>
</template>

<script>
import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
export default {
  name: "Right",
  computed: {
    ...mapState(["count"]),
    ...mapGetters(["allDone"]),
  },
  methods: {
    ...mapMutations(["manCount"]),
    ...mapActions(["getBooks2"]),
    fn() {
      this.manCount(-10);
    },
  },
  created() {
    this.getBooks2();
  },
};
</script>

<style></style>
